package org.p2psimulator.entity.reputation.gnutellabased;

import org.p2psimulator.engine.Environment;
import org.p2psimulator.entity.Id;
import org.p2psimulator.entity.reputation.ReputationManager;
import org.p2psimulator.entity.reputation.ReputationRepository;
import org.p2psimulator.entity.reputation.ReputationRepositoryTypes;
import org.p2psimulator.exceptions.ReputationManagerException;

public class BayesianReputationManager extends ReputationManager {

	@Override
	public void loadRepositories(Environment env)
			throws ReputationManagerException {
            this.env = env;
		repositoryMap.put(ReputationRepositoryTypes.REP_SERVENT_REPOSITORY,
				new ReputationRepository(this, env));


		repositoryMap.put(ReputationRepositoryTypes.TRUST_REPOSITORY,
				new ReputationRepository(this, env));

		for (Id id : env.getPeerBank().getPeerMap().keySet()){
			repositoryMap.get(ReputationRepositoryTypes.REP_SERVENT_REPOSITORY).addServent(id);
			repositoryMap.get(ReputationRepositoryTypes.TRUST_REPOSITORY).addServent(id);
		}

	}

}
